home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / amipro3 / macros.cmz / MASTRDOC.SMM < prev    next >
Encoding:
INI File  |  1992-11-18  |  11.6 KB  |  782 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     _macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Permite examinar los archivos que componen un documento maestro.
  19.     Lotus Word Processing Division
  20.     Advanced
  21.     Define, MasterDoc
  22.     autorun
  23.     717188745
  24.     17
  25.     676166658
  26.     162
  27.     5
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     0
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [ParaNum]
  54.     1
  55. [tag]
  56.     Est<\a>ndar
  57.     5
  58.     [fnt]
  59.         Tms Rmn
  60.         240
  61.         0
  62.         49152
  63.     [algn]
  64.         1
  65.         1
  66.         0
  67.         0
  68.         0
  69.     [spc]
  70.         17
  71.         0
  72.         1
  73.         0
  74.         0
  75.         1
  76.         100
  77.     [brk]
  78.         4
  79.     [line]
  80.         8
  81.         0
  82.         1
  83.         0
  84.         1
  85.         1
  86.         1
  87.         10
  88.         10
  89.         1
  90.     [spec]
  91.         0
  92.         0
  93.         
  94.         0
  95.         1
  96.         1
  97.         0
  98.         0
  99.         0
  100.         0
  101.     [nfmt]
  102.         24
  103.         1
  104.         2
  105.         ,
  106.         .
  107.         Pts
  108.     Est<\a>ndar
  109.     0
  110.     0
  111. [tag]
  112.     Standard
  113.     6
  114.     [fnt]
  115.         Tms Rmn
  116.         240
  117.         0
  118.         49152
  119.     [algn]
  120.         1
  121.         1
  122.         0
  123.         0
  124.         0
  125.     [spc]
  126.         17
  127.         0
  128.         1
  129.         0
  130.         0
  131.         1
  132.         100
  133.     [brk]
  134.         4
  135.     [line]
  136.         8
  137.         0
  138.         1
  139.         0
  140.         1
  141.         1
  142.         1
  143.         10
  144.         10
  145.         1
  146.     [spec]
  147.         0
  148.         0
  149.         
  150.         0
  151.         1
  152.         0
  153.         0
  154.         0
  155.         0
  156.         0
  157.     [nfmt]
  158.         24
  159.         1
  160.         2
  161.         ,
  162.         .
  163.         Pts
  164.     Standard
  165.     0
  166.     0
  167. [l1]
  168.     0
  169. [pg]
  170.     5
  171.     40 0 17 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  172.     82 0 17 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  173.     130 0 15 64 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  174.     136 0 5 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  175.     163 0 0 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  176. [edoc]
  177. <:#558,9025>' Master File Browser  - these macros will allow the user to "Next" and "Prev" through the files
  178.  
  179. <:#279,9025>' of a master document.   We add a cascading menu off the file menu.  Here they can "INIT" , 
  180.  
  181. <:#279,9025>' Next and Prev.
  182.  
  183. <:#279,9025>' We keep the filenames in a global array.
  184.  
  185. <:#279,9025>
  186.  
  187. <:#279,9025>DEFINE    GlobID         "MasterFiles"
  188.  
  189. <:#279,9025>DEFINE    GlobIDC        "MasterCount"
  190.  
  191. <:#279,9025>DEFINE    GetFile(which)    GetGlobalArray$(GlobID, %1)
  192.  
  193. <:#279,9025>DEFINE    MaxID()        GetGlobalArray$(GlobIDC, 1)
  194.  
  195. <:#279,9025>DEFINE    SetMaxID(max)    SetGlobalArray(GlobIDC, 1, %1)
  196.  
  197. <:#279,9025>DEFINE    SetFile(index, name)    SetGlobalArray(GlobID, %1, %2)
  198.  
  199. <:#279,9025>declare    AlreadyOpened(p1)
  200.  
  201. <:#279,9025>Declare OpenOne(p1)
  202.  
  203. <:#279,9025>
  204.  
  205. <:#279,9025>' AddOurMenu - This just adds us to the menu
  206.  
  207. <:#279,9025>
  208.  
  209. @Function@<:#293,9025>FUNCTION AddOurMenu()
  210.  
  211. <:#279,9025>IF IsNewWave()
  212.  
  213. <:#279,9025>    Message("Macro no disponible si se ejecuta en HP NewWave.")
  214.  
  215. <:#279,9025>    Exit Function
  216.  
  217. <:#279,9025>ENDIF
  218.  
  219. <:#279,9025>'singlestep(0)
  220.  
  221. <:#279,9025>AllocGlobalVar("Init",1)
  222.  
  223. <:#279,9025>SetGlobalVar("Init",0)
  224.  
  225. <:#279,9025>
  226.  
  227. <:#279,9025>menu = "&Archivo";                    ' Which menu
  228.  
  229. <:#279,9025>submenu = "E&xaminar doc. maestro";            ' Our name
  230.  
  231. <:#279,9025>DeleteMenu(1, menu, Submenu);            ' Delete old if there
  232.  
  233. <:#279,9025>
  234.  
  235. <:#279,9025>InsertCascadeMenu(1, menu, 8, submenu)
  236.  
  237. <:#279,9025>
  238.  
  239. <:#279,9025>InitMac = StrCat$(GetRunningMacroFile$(), "!OpenMaster")
  240.  
  241. <:#558,9025>AddCascadeMenuItem(1, menu, submenu, "&Comenzar", InitMac, "Comienza a examinar un documento maestro")
  242.  
  243. <:#279,9025>
  244.  
  245. <:#279,9025>NextMac = StrCat$(GetRunningMacroFile$(), "!NextMaster")
  246.  
  247. <:#558,9025>AddCascadeMenuItem(1, menu, submenu, "&Siguiente", NextMac, "Examina el siguiente archivo del documento maestro")
  248.  
  249. <:#279,9025>
  250.  
  251. <:#279,9025>PrevMac = StrCat$(GetRunningMacroFile$(), "!PrevMaster")
  252.  
  253. AddCascadeMenuItem(1, menu, submenu, "&Anterior", PrevMac, "Examina el archivo anterior del documento maestro")
  254.  
  255. END FUNCTION<:p<* >>
  256.  
  257. <:#279,9025>
  258.  
  259. <:#558,9025>' OpenMaster - Get the list of files for a master document, then load them into the global array
  260.  
  261. <:#279,9025>
  262.  
  263. @Function@<:#293,9025>FUNCTION OpenMaster()
  264.  
  265. <:#279,9025>'singlestep(0)
  266.  
  267. <:#279,9025>defstr mascount;
  268.  
  269. <:#279,9025>if (0 = Assign(&mascount, GetMasterFilesCount()))
  270.  
  271.     message("El archivo actual no es un documento maestro.")
  272.  
  273. <:#279,9025>    return -1;
  274.  
  275. <:#279,9025>endif
  276.  
  277. <:#279,9025>AllocGlobalVar(GlobID, mascount)            ' Where we keep the names
  278.  
  279. <:#279,9025>AllocGlobalVar(GlobIDC, 1)                ' How we know how many
  280.  
  281. <:#279,9025>SetGlobalVar("Init",1)
  282.  
  283. <:#279,9025>dim    masfiles(mascount)                ' load our local array
  284.  
  285. <:#279,9025>GetMasterFiles(&masfiles)                ' then transfer them to the 
  286.  
  287. <:#279,9025>for i = 1 to mascount                    ' Global array
  288.  
  289. <:#279,9025>    SetFile(i, UCase$(masfiles(i)))        ' Upper case all for compares later
  290.  
  291. <:#279,9025>next
  292.  
  293. <:#279,9025>SetMaxID(mascount)
  294.  
  295. <:#279,9025>
  296.  
  297. <:#279,9025>' Now load the first master file.
  298.  
  299. <:#279,9025>
  300.  
  301. <:#279,9025>fname = masfiles(1)
  302.  
  303. <:#279,9025>if (AlreadyOpened(fname))
  304.  
  305. <:#279,9025>    SelectWindow(fname)
  306.  
  307. <:#279,9025>else
  308.  
  309. <:#279,9025>    OpenOne(masfiles(1))
  310.  
  311. <:#279,9025>endif
  312.  
  313. <:#279,9025>END FUNCTION
  314.  
  315. <:#279,9025>
  316.  
  317. <:#279,9025>' IsCurrentAMaster - is the active window one of the master files?
  318.  
  319. <:#279,9025>'    RETURN 0 if not one of the master files otherwise its ordered number
  320.  
  321. <:#279,9025>
  322.  
  323. @Function@<:#293,9025>FUNCTION IsCurrentAMaster()
  324.  
  325. <:#279,9025>cur = UCase$(GetOpenFileName$())        ' Upper case the current
  326.  
  327. <:#279,9025>for i = 1 to MaxID()                ' Run though all master files
  328.  
  329. <:#279,9025>    if (cur = GetFile(i))            ' Found one?
  330.  
  331. <:#279,9025>        return i                ' Yes, return its index
  332.  
  333. <:#279,9025>    endif
  334.  
  335. <:#279,9025>next
  336.  
  337. <:#279,9025>return 0;                    ' Not found.
  338.  
  339. END FUNCTION<:p<* >>
  340.  
  341. <:#279,9025>
  342.  
  343. <:#558,9025>' NextMaster - Called from the menu.  Get the active window's file, determine if its part of the 
  344.  
  345. <:#279,9025>'    master file, if so either open or select the next file.
  346.  
  347. <:#279,9025>'
  348.  
  349. @Function@<:#293,9025>FUNCTION NextMaster()
  350.  
  351. <:#279,9025>Declare AlreadyOpened(p1)
  352.  
  353. <:#279,9025>InitStat = GetGlobalVar$("Init")
  354.  
  355. <:#279,9025>If InitStat = 0
  356.  
  357.     Message("Seleccione la funci<\s>n Comenzar")
  358.  
  359. <:#279,9025>    Exit Function
  360.  
  361. <:#279,9025>Endif
  362.  
  363. <:#279,9025>id = IsCurrentAMaster()            ' The active window part of master document?
  364.  
  365. <:#279,9025>if (0 != id AND id << MaxID())
  366.  
  367. <:#279,9025>
  368.  
  369. <:#279,9025>    ' NOTE the parentheses around the id + 1, is required for the define's parameter 
  370.  
  371. <:#279,9025>    ' substitution.  Without the parentheses there would be 3 parameters, not 1!
  372.  
  373. <:#279,9025>
  374.  
  375. <:#279,9025>    fname = GetFile((id + 1))        ' Get the next one
  376.  
  377. <:#279,9025>    if NOT AlreadyOpened(fname)    ' If its not opened
  378.  
  379. <:#279,9025>        OpenOne(fname)        ' Open it
  380.  
  381. <:#279,9025>    else
  382.  
  383. <:#279,9025>        SelectWindow(fname)    ' Otherwise just select it
  384.  
  385. <:#279,9025>    endif
  386.  
  387. <:#279,9025>elseif (0 = id)
  388.  
  389.     Message("El archivo actual no forma parte del documento maestro seleccionado.")
  390.  
  391. <:#279,9025>else
  392.  
  393.     Message("No hay m<\a>s archivos.")
  394.  
  395. <:#279,9025>endif
  396.  
  397. <:#279,9025>END FUNCTION
  398.  
  399. <:#279,9025>
  400.  
  401. <:#279,9025>' PrevMaster - select the previous file.
  402.  
  403. <:#279,9025>
  404.  
  405. @Function@<:#293,9025>FUNCTION PrevMaster()
  406.  
  407. <:#279,9025>InitStat = GetGlobalVar$("Init")
  408.  
  409. <:#279,9025>If InitStat = 0
  410.  
  411.     Message("Seleccione la funci<\s>n Comenzar")
  412.  
  413. <:#279,9025>    Exit Function
  414.  
  415. <:#279,9025>Endif
  416.  
  417. <:#279,9025>
  418.  
  419. <:#279,9025>id = IsCurrentAMaster()
  420.  
  421. <:#279,9025>if (id <;> 1)
  422.  
  423. <:#279,9025>    fname = GetFile((id - 1))
  424.  
  425. <:#279,9025>    if NOT AlreadyOpened(fname)
  426.  
  427. <:#279,9025>        OpenOne(fname)
  428.  
  429. <:#279,9025>    else
  430.  
  431. <:#279,9025>        SelectWindow(fname)
  432.  
  433. <:#279,9025>    endif
  434.  
  435. <:#279,9025>elseif (0 = id)
  436.  
  437.     Message("El archivo actual no forma parte del documento maestro seleccionado.")
  438.  
  439. <:#279,9025>else
  440.  
  441.     Message("Este es el primer archivo del documento maestro.")
  442.  
  443. <:#279,9025>endif
  444.  
  445. <:#279,9025>END FUNCTION
  446.  
  447. <:p<* >>
  448.  
  449. <:#240,9360>' AlreadyOpened - is the passed file already open?
  450.  
  451. <:#240,9360>'     RETURN TRUE is so.
  452.  
  453. <:#240,9360>
  454.  
  455. @Function@<:#240,9360>FUNCTION AlreadyOpened(fname)
  456.  
  457. <:#240,9360>filecnt = GetOpenFileCount()
  458.  
  459. <:#240,9360>dim files(filecnt)
  460.  
  461. <:#240,9360>GetOpenFileNames(&files)            ' Get the list of files
  462.  
  463. <:#240,9360>for i = 1 to filecnt
  464.  
  465. <:#240,9360>    if (fname = files(i))            ' match?
  466.  
  467. <:#240,9360>        return 1;            ' Is is open.
  468.  
  469. <:#240,9360>    endif
  470.  
  471. <:#240,9360>next
  472.  
  473. <:#240,9360>return 0;                    ' No open
  474.  
  475. <:#240,9360>END FUNCTION
  476.  
  477. <:#240,9360>
  478.  
  479. <:#480,9360>' OpenOne - Open a file, give it its own window, if we dont already have 9 open.
  480.  
  481. <:#240,9360>
  482.  
  483. @Function@<:#240,9360>FUNCTION OpenOne(fname)
  484.  
  485. <:#240,9360>cnt = GetOpenFileCount()
  486.  
  487. <:#240,9360>if (cnt << 9)
  488.  
  489. <:#240,9360>    openopt = 1
  490.  
  491. <:#240,9360>else
  492.  
  493. <:#240,9360>    openopt = 129
  494.  
  495. <:#240,9360>endif
  496.  
  497. <:#240,9360>FileOpen(fname, openopt, "")
  498.  
  499. <:#240,9360>END FUNCTION
  500.  
  501. <:#284,9360>
  502.  
  503. >
  504.  
  505. [Embedded]
  506. 00008771
  507. >
  508. [macsum] 7
  509. AddOurMenu 0 0 6 16
  510. OpenMaster 646 0 5 43
  511. IsCurrentAMaster 1178 0 3 73
  512. NextMaster 1440 0 4 86
  513. PrevMaster 1975 0 4 114
  514. AlreadyOpened 2492 1 4 139
  515. OpenOne 2722 1 3 153
  516. [macse]
  517. 14 AddOurMenu
  518. 0 1317
  519. 13
  520. 11 00000108
  521. 0 3 "Macro no disponible si se ejecuta en HP NewWave."
  522. 6 0
  523. 15
  524. 9
  525. 0 271 "Init" 1
  526. 0 264 "Init" 0
  527. 7 "&Archivo"
  528. 8 1
  529. 7 "E&xaminar doc. maestro"
  530. 8 2
  531. 0 521 1 "{1}" "{2}"
  532. 0 528 1 "{1}" 8 "{2}"
  533. 0 802
  534. 13
  535. 0 16 [X] "!OpenMaster"
  536. 13
  537. 8 3
  538. 0 525 1 "{1}" "{2}" "&Comenzar" "{3}" "Comienza a examinar un documento maestro"
  539. 0 802
  540. 13
  541. 0 16 [X] "!NextMaster"
  542. 13
  543. 8 4
  544. 0 525 1 "{1}" "{2}" "&Siguiente" "{4}" "Examina el siguiente archivo del documento maestro"
  545. 0 802
  546. 13
  547. 0 16 [X] "!PrevMaster"
  548. 13
  549. 8 5
  550. 0 525 1 "{1}" "{2}" "&Anterior" "{5}" "Examina el archivo anterior del documento maestro"
  551. 6 0
  552. 15
  553. 9
  554. 14 OpenMaster
  555. 5 0
  556. 0 1047
  557. 13
  558. 0 805 &1 [X]
  559. 13
  560. 18 0
  561. 11 00000135
  562. 0 3 "El archivo actual no es un documento maestro."
  563. 5 -1
  564. 15
  565. 9
  566. 0 271 "MasterFiles" "{1}"
  567. 0 271 "MasterCount" 1
  568. 0 264 "Init" 1
  569. 6 1
  570. 21 2 [X]
  571. 0 1048 &2
  572. 5 1
  573. 8 3
  574. 6 1
  575. 6 3
  576. 18 2
  577. 12 00000312
  578. 10 00000381
  579. 5 1
  580. 6 3
  581. 3 0
  582. 8 3
  583. 10 00000237
  584. 6 3
  585. 22 2
  586. 0 18 [X]
  587. 13
  588. 0 272 "MasterFiles" "{3}" [X]
  589. 10 00000279
  590. 0 272 "MasterCount" 1 "{1}"
  591. 5 1
  592. 22 2
  593. 8 4
  594. 16 AlreadyOpened "{4}"
  595. 13
  596. 11 00000493
  597. 0 796 "{4}"
  598. 10 00000520
  599. 5 1
  600. 22 2
  601. 16 OpenOne [X]
  602. 6 0
  603. 15
  604. 9
  605. 14 IsCurrentAMaster
  606. 0 267
  607. 13
  608. 0 18 [X]
  609. 13
  610. 8 1
  611. 5 1
  612. 8 2
  613. 0 273 "MasterCount" 1
  614. 13
  615. 6 2
  616. 18 2
  617. 12 00000158
  618. 10 00000238
  619. 5 1
  620. 6 2
  621. 3 0
  622. 8 2
  623. 10 00000061
  624. 6 1
  625. 0 273 "MasterFiles" "{2}"
  626. 13
  627. 18 0
  628. 11 00000225
  629. 6 2
  630. 15
  631. 9
  632. 10 00000125
  633. 5 0
  634. 15
  635. 9
  636. 6 0
  637. 15
  638. 9
  639. 14 NextMaster
  640. 0 265 "Init"
  641. 13
  642. 8 1
  643. 6 1
  644. 5 0
  645. 18 0
  646. 11 00000120
  647. 0 3 "Seleccione la funci<\s>n Comenzar"
  648. 6 0
  649. 15
  650. 9
  651. 16 IsCurrentAMaster
  652. 13
  653. 8 2
  654. 5 0
  655. 6 2
  656. 18 1
  657. 6 2
  658. 0 273 "MasterCount" 1
  659. 13
  660. 18 5
  661. 1 1
  662. 11 00000374
  663. 6 2
  664. 5 1
  665. 3 0
  666. 0 273 "MasterFiles" [X]
  667. 13
  668. 8 3
  669. 16 AlreadyOpened "{3}"
  670. 13
  671. 1 3
  672. 11 00000348
  673. 16 OpenOne "{3}"
  674. 10 00000361
  675. 0 796 "{3}"
  676. 10 00000523
  677. 5 0
  678. 6 2
  679. 18 0
  680. 11 00000492
  681. 0 3 "El archivo actual no forma parte del documento maestro seleccionado."
  682. 10 00000523
  683. 0 3 "No hay m<\a>s archivos."
  684. 6 0
  685. 15
  686. 9
  687. 14 PrevMaster
  688. 0 265 "Init"
  689. 13
  690. 8 1
  691. 6 1
  692. 5 0
  693. 18 0
  694. 11 00000120
  695. 0 3 "Seleccione la funci<\s>n Comenzar"
  696. 6 0
  697. 15
  698. 9
  699. 16 IsCurrentAMaster
  700. 13
  701. 8 2
  702. 6 2
  703. 5 1
  704. 18 3
  705. 11 00000331
  706. 6 2
  707. 5 1
  708. 3 1
  709. 0 273 "MasterFiles" [X]
  710. 13
  711. 8 3
  712. 16 AlreadyOpened "{3}"
  713. 13
  714. 1 3
  715. 11 00000305
  716. 16 OpenOne "{3}"
  717. 10 00000318
  718. 0 796 "{3}"
  719. 10 00000505
  720. 5 0
  721. 6 2
  722. 18 0
  723. 11 00000449
  724. 0 3 "El archivo actual no forma parte del documento maestro seleccionado."
  725. 10 00000505
  726. 0 3 "Este es el primer archivo del documento maestro."
  727. 6 0
  728. 15
  729. 9
  730. 14 AlreadyOpened
  731. 0 1050
  732. 13
  733. 8 2
  734. 6 2
  735. 21 3 [X]
  736. 0 1051 &3
  737. 5 1
  738. 8 4
  739. 6 2
  740. 6 4
  741. 18 2
  742. 12 00000146
  743. 10 00000206
  744. 5 1
  745. 6 4
  746. 3 0
  747. 8 4
  748. 10 00000071
  749. 6 0
  750. 6 4
  751. 22 3
  752. 18 0
  753. 11 00000193
  754. 5 1
  755. 15
  756. 9
  757. 10 00000113
  758. 5 0
  759. 15
  760. 9
  761. 6 1
  762. 15
  763. 9
  764. 14 OpenOne
  765. 0 1050
  766. 13
  767. 8 2
  768. 6 2
  769. 5 9
  770. 18 5
  771. 11 00000081
  772. 5 1
  773. 8 3
  774. 10 00000093
  775. 5 129
  776. 8 3
  777. 2 102 1 "{0}" "{3}" ""
  778. 6 1
  779. 15
  780. 9
  781. 00008796
  782.